package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.School;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.SchoolManager;

public class SchoolManagerImpl extends AbstractManager implements SchoolManager{

	@Override
	public void addSchool(School school) {
		getHibernateTemplate().save(school);
	}

	@Override
	public void delSchoolById(String id) {

		getHibernateTemplate().delete(findSchoolById(id));
	}

	@Override
	public PagerModel findAllSchools() {

		return searchPaginate("select s from School s");
	}

	@Override
	public School findSchoolById(String id) {

		return (School)getHibernateTemplate().load(School.class, id);
	}

	@Override
	public void updateSchool(School school) {

		getHibernateTemplate().update(school);
	}

}
